home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / tsqed16.zip / DATE.QMA < prev    next >
Text File  |  1992-01-01  |  4KB  |  138 lines

  1. *                                                All rights reserved
  2. * Date commands giving the month as three letters (as below)
  3. * By Prof. Timo Salmi Wed 01-Jan-92
  4. *
  5. * To compile these macros apply QMAC DATE.MAC DATE.QMA /A- /B
  6. *
  7. * The QMAC.EXE macro translator is from
  8. * garbo.uwasa.fi:/pc/editor/qmac215.zip
  9. * (Also the earlier version 2.1 will do).
  10. *
  11. * To make these macros available you can e.g. first invoke the main menu
  12. * (usually F10) and select Macro: Read Macro: date.mac. Then you can
  13. * invoke the commands with ALT-4, ALT-5 and ALT-6, respectively.
  14. *
  15. * To write the current date and time like Thu 26-Dec-91  08:36:18
  16. * use alt-4 alt-5 atl-6 in succession.
  17.  
  18. * ┌───────────────────────────────────────────────────────────┐
  19. * │ Insert the date and convert the month into letters, ALT-4 │
  20. * └───────────────────────────────────────────────────────────┘
  21. @4 MacroBegin
  22.  
  23. *
  24. * Use a temporary file
  25.      EditFile "$qedbuff.tmp" Return
  26. *
  27. * Invoke the date and go to its beginning
  28.      InsertDate
  29.      MarkBlockEnd
  30.      WordLeft WordLeft WordLeft WordLeft
  31.      MarkBlockBegin
  32. *
  33. * Replace the month number with the three-letter format
  34. * If you want a longer format, just edit the month names accordingly
  35.      FindReplace " 01-" Return " Jan-" Return Return
  36.      JFalse label2:
  37.      "y"
  38.  
  39.      label2:
  40.      FindReplace " 02-" Return " Feb-" Return Return
  41.      JFalse label3:
  42.      "y"
  43.  
  44.      label3:
  45.      FindReplace " 03-" Return " Mar-" Return Return
  46.      JFalse label4:
  47.      "y"
  48.  
  49.      label4:
  50.      FindReplace " 04-" Return " Apr-" Return Return
  51.      JFalse label5:
  52.      "y"
  53.  
  54.      label5:
  55.      FindReplace " 05-" Return " May-" Return Return
  56.      JFalse label6:
  57.      "y"
  58.  
  59.      label6:
  60.      FindReplace " 06-" Return " Jun-" Return Return
  61.      JFalse label7:
  62.      "y"
  63.  
  64.      label7:
  65.      FindReplace " 07-" Return " Jul-" Return Return
  66.      JFalse label8:
  67.      "y"
  68.  
  69.      label8:
  70.      FindReplace " 08-" Return " Aug-" Return Return
  71.      JFalse label9:
  72.      "y"
  73.  
  74.      label9:
  75.      FindReplace " 09-" Return " Sep-" Return Return
  76.      JFalse label10:
  77.      "y"
  78.  
  79.      label10:
  80.      FindReplace " 10-" Return " Oct-" Return Return
  81.      JFalse label11:
  82.      "y"
  83.  
  84.      label11:
  85.      FindReplace " 11-" Return " Nov-" Return Return
  86.      JFalse label12:
  87.      "y"
  88.  
  89.      label12:
  90.      FindReplace " 12-" Return " Dec-" Return Return
  91.      JFalse label13:
  92.      "y"
  93. *
  94.      label13:
  95. *
  96. * Delete the first two digits in the year
  97. * Comment away these three lines if to do not want the deletion
  98.      GotoBlockEnd
  99.      CursorLeft CursorLeft CursorLeft CursorLeft
  100.      BackSpace BackSpace
  101. *
  102. * Assure that the line feed is not included
  103.      GotoBlockEnd
  104.      CursorRight CursorRight "marker"
  105.      GotoBlockEnd
  106. *
  107. * Move the results to the actual file being edited
  108.      PrevFile
  109.      MoveBlock
  110.      GotoBlockEnd
  111. *
  112. * Discard the temporary file
  113.      EditFile "$qedbuff.tmp" Return
  114.      Exit
  115.      "n"
  116.      UnmarkBlock
  117. *
  118. * ┌──────────────────────────────────────────────────────┐
  119. * │ Switch the day and the month (European style), ALT-5 │
  120. * └──────────────────────────────────────────────────────┘
  121. @5 MacroBegin
  122.     WordLeft WordLeft WordLeft
  123.     backspace
  124.     WordRight
  125.     MarkBlockBegin
  126.     WordRight
  127.     MarkBlockEnd
  128.     WordLeft WordLeft
  129.     MoveBlock
  130.     UnmarkBlock
  131.     WordRight WordRight WordRight
  132.     "  "
  133.  
  134. * ┌──────────────────────────────────────────────┐
  135. * │ Insert the time in an ordinary format, ALT-6 │
  136. * └──────────────────────────────────────────────┘
  137. @6 InsertTime
  138.